<script>
  function downloadAttachment${field.name?replace('.','_')}(attachmentId) {
  	var url = TDQS.CONTEXT_PATH+"/download/downLoadAttachment?attachmentId="+attachmentId+"&date="+new Date().toLocaleString();
  	//window.open(url);
  	var frame = document.createElement("iframe");
		frame.src = url;
		frame.style.display = "none";
		document.body.appendChild(frame);
  }
  function viewAttachment${field.name?replace('.','_')}(attachmentId) {
  	var url = TDQS.CONTEXT_PATH+"/download/viewAttachment?attachmentId="+attachmentId+"&instanceId=<#if businessInstanceField?? && businessInstanceField.instance?? && businessInstanceField.instance.id??>${businessInstanceField.instance.id}</#if>&date="+new Date().toLocaleString();
    window.open(url);
  }
  function deleteAttachment${field.name?replace('.','_')}(index) {
	  	jConfirm('确认要删除附件吗？', '确认对话框 ', function(r) {
				if(r){
	                      $(document.getElementById('fileInfo${field.name}'+index)).remove();
	                  }else{
	                      return false;
	                  }
		});
  }
</script>

<#-- 定义宏，输出必填红星号 -->
<#macro renderMandatory>
<#if !formField.readonly?? || formField.readonly=="0">
	<#--<span class="placeholder fontRed">*</span>-->
</#if>
</#macro>

<#if !formField.readonly?? || formField.readonly=="0">
<input type=hidden name="fieldMap['${field.name}'].field.id"  value="${formField.field.id}">
<input type="hidden" name="fieldMap['${field.name}'].entityId" <#if currentyearfee?? && currentyearfee.id??>value="${currentyearfee.id}"</#if>>
<input type="hidden" name="fieldMap['${field.name}'].planYearFee.id" <#if currentyearfee?? && currentyearfee.id?? >value="${currentyearfee.id}"</#if>>
<input type="hidden" name="fieldMap['${field.name}'].planYearFee.totalCost.id" <#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.id??>value="${currentyearfee.totalCost.id}"</#if>>
<input type="hidden" name="fieldMap['${field.name}'].planYearFee.paidCost.id" <#if currentyearfee?? && currentyearfee.paidCost?? && currentyearfee.paidCost.id??>value="${currentyearfee.paidCost.id}"</#if>>
<input type="hidden" name="fieldMap['${field.name}'].planYearFee.planCost.id" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.id??>value="${currentyearfee.planCost.id}"</#if>>
</#if>

<table cellspacing="0" width="100%" border="0" cellpadding="0" >
	<tr>
		<td>
			<table id="feeTable" cellspacing="0" width="100%" border="0" cellpadding="0">
				<tr class="listviewHeader">
					<td colspan="2" align="left">
					前期协调费
					</td>
				</tr>
				<tr class="listviewTR">
					
					<td width="10%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="90%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"前期协调当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.manageCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.manageCost??>value="${currentyearfee.planCost.manageCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.manageCost??>${currentyearfee.planCost.manageCost?c}</#if>&nbsp;&nbsp;万元
						</#if>				
					</td>
				</tr>
				<#if yearfee_type?default('1') != "2">
				<tr class="listviewHeader">
					<td colspan="6" align="left">
					选址选线
					</td>
				</tr>
				<tr class="listviewTR">
					<td width="8%" class="listviewTD" align="right">总费用：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input datarule="number"  datarulejson='{"displayName":"选址选线总费用","precision":"6","length":"8"}' cost="total"  type="text" class="text" name="fieldMap['${field.name}'].planYearFee.totalCost.locationCost" <#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.locationCost??>value="${currentyearfee.totalCost.locationCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.locationCost??>${currentyearfee.totalCost.locationCost?c}</#if>&nbsp;&nbsp;万元
						</#if>
					</td>
					<td width="8%" class="listviewTD" align="right">已拨付：</td>
					<td width="25%" class="listviewContent">
						<label cost="paid"><#if currentyearfee?? && currentyearfee.paidCost?? && currentyearfee.paidCost.locationCost??>${currentyearfee.paidCost.locationCost?c}</#if></label>&nbsp;&nbsp;万元
					</td>
					<td width="8%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"选址选线当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.locationCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.locationCost??>value="${currentyearfee.planCost.locationCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.locationCost??>${currentyearfee.planCost.locationCost?c}</#if>&nbsp;&nbsp;万元
						</#if>
					</td>
				</tr>
				<tr class="listviewHeader">
					<td colspan="6" align="left">
					招标代理
					</td>
				</tr>
				<tr class="listviewTR">
					<td width="8%" class="listviewTD" align="right">总费用：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input datarule="number"  datarulejson='{"displayName":"招标代理总费用","precision":"6","length":"8"}' cost="total"  type="text" class="text" name="fieldMap['${field.name}'].planYearFee.totalCost.desginCost" <#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.desginCost??>value="${currentyearfee.totalCost.desginCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.desginCost??>${currentyearfee.totalCost.desginCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
					<td width="8%" class="listviewTD" align="right">已拨付：</td>
					<td width="25%" class="listviewContent">
						<label cost="paid"><#if currentyearfee?? && currentyearfee.paidCost?? && currentyearfee.paidCost.desginCost??>${currentyearfee.paidCost.desginCost?c}</#if></label>&nbsp;&nbsp;万元
					</td>
					<td width="8%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"招标代理当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.desginCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.desginCost??>value="${currentyearfee.planCost.desginCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.desginCost??>${currentyearfee.planCost.desginCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
				</tr>
				</#if>
				<tr class="listviewHeader">
					<td colspan="2" align="left">
					可研编制
					</td>
				</tr>
				<tr class="listviewTR">
					
					<td width="10%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="90%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"可研编制当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.feasibilityCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.feasibilityCost??>value="${currentyearfee.planCost.feasibilityCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.feasibilityCost??>${currentyearfee.planCost.feasibilityCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
				</tr>
				<tr class="listviewHeader">
					<td colspan="2" align="left">
					可研评审
					</td>
				</tr>
				<tr class="listviewTR">
					
					<td width="10%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="90%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"可研评审当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.feasibilityReviewCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.feasibilityReviewCost??>value="${currentyearfee.planCost.feasibilityReviewCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.feasibilityReviewCost??>${currentyearfee.planCost.feasibilityReviewCost?c}</#if>&nbsp;&nbsp;万元
						</#if>
					</td>
				</tr>
				<#if yearfee_type?default('1') != "2">
				<tr class="listviewHeader">
					<td colspan="6" align="left">
					环评
					</td>
				</tr>
				<tr class="listviewTR">
				
					<td width="8%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"环评当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.environmentCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.environmentCost??>value="${currentyearfee.planCost.environmentCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.environmentCost??>${currentyearfee.planCost.environmentCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
				</tr>
				<tr class="listviewHeader">
					<td colspan="6" align="left">
					水保
					</td>
				</tr>
				<tr class="listviewTR">
					<td width="8%" class="listviewTD" align="right">总费用：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input datarule="number"  datarulejson='{"displayName":"水保总费用","precision":"6","length":"8"}' cost="total"  type="text" class="text" name="fieldMap['${field.name}'].planYearFee.totalCost.waterCost" <#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.waterCost??>value="${currentyearfee.totalCost.waterCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.waterCost??>${currentyearfee.totalCost.waterCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
					<td width="8%" class="listviewTD" align="right">已拨付：</td>
					<td width="25%" class="listviewContent">
						<label cost="paid"><#if currentyearfee?? && currentyearfee.paidCost?? && currentyearfee.paidCost.waterCost??>${currentyearfee.paidCost.waterCost?c}</#if></label>&nbsp;&nbsp;万元
					</td>
					<td width="8%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"水保当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.waterCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.waterCost??>value="${currentyearfee.planCost.waterCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.waterCost??>${currentyearfee.planCost.waterCost?c}</#if>&nbsp;&nbsp;万元
						</#if>
					</td>
				</tr>
				<tr class="listviewHeader">
					<td colspan="6" align="left">
					规划选址评估
					</td>
				</tr>
				<tr class="listviewTR">
					<td width="8%" class="listviewTD" align="right">总费用：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input datarule="number"  datarulejson='{"displayName":"规划选址评估总费用","precision":"6","length":"8"}' cost="total"  type="text" class="text" name="fieldMap['${field.name}'].planYearFee.totalCost.planLocationCost" <#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.planLocationCost??>value="${currentyearfee.totalCost.planLocationCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.planLocationCost??>${currentyearfee.totalCost.planLocationCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
					<td width="8%" class="listviewTD" align="right">已拨付：</td>
					<td width="25%" class="listviewContent">
						<label cost="paid"><#if currentyearfee?? && currentyearfee.paidCost?? && currentyearfee.paidCost.planLocationCost??>${currentyearfee.paidCost.planLocationCost?c}</#if></label>&nbsp;&nbsp;万元
					</td>
					<td width="8%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"规划选址评估当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.planLocationCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.planLocationCost??>value="${currentyearfee.planCost.planLocationCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.planLocationCost??>${currentyearfee.planCost.planLocationCost?c}</#if>&nbsp;&nbsp;万元
						</#if>
					</td>
				</tr>
				<tr class="listviewHeader">
					<td colspan="6" align="left">
					土地调规
					</td>
				</tr>
				<tr class="listviewTR">
					<td width="8%" class="listviewTD" align="right">总费用：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input datarule="number"  datarulejson='{"displayName":"土地调规总费用","precision":"6","length":"8"}' cost="total"  type="text" class="text" name="fieldMap['${field.name}'].planYearFee.totalCost.landCost" <#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.landCost??>value="${currentyearfee.totalCost.landCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.landCost??>${currentyearfee.totalCost.landCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
					<td width="8%" class="listviewTD" align="right">已拨付：</td>
					<td width="25%" class="listviewContent">
						<label cost="paid"><#if currentyearfee?? && currentyearfee.paidCost?? && currentyearfee.paidCost.landCost??>${currentyearfee.paidCost.landCost?c}</#if></label>&nbsp;&nbsp;万元
					</td>
					<td width="8%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"土地调规当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.landCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.landCost??>value="${currentyearfee.planCost.landCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.landCost??>${currentyearfee.planCost.landCost?c}</#if>&nbsp;&nbsp;万元
						</#if>
					</td>
				</tr>
				<tr class="listviewHeader">
					<td colspan="6" align="left">
					节能评估
					</td>
				</tr>
				<tr class="listviewTR">
					<td width="8%" class="listviewTD" align="right">总费用：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input datarule="number"  datarulejson='{"displayName":"节能评估总费用","precision":"6","length":"8"}' cost="total"  type="text" class="text" name="fieldMap['${field.name}'].planYearFee.totalCost.powerEvalCost" <#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.powerEvalCost??>value="${currentyearfee.totalCost.powerEvalCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.powerEvalCost??>${currentyearfee.totalCost.powerEvalCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
					<td width="8%" class="listviewTD" align="right">已拨付：</td>
					<td width="25%" class="listviewContent">
						<label cost="paid"><#if currentyearfee?? && currentyearfee.paidCost?? && currentyearfee.paidCost.powerEvalCost??>${currentyearfee.paidCost.powerEvalCost?c}</#if></label>&nbsp;&nbsp;万元
					</td>
					<td width="8%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"节能评估当年计划","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.powerEvalCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.powerEvalCost??>value="${currentyearfee.planCost.powerEvalCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.powerEvalCost??>${currentyearfee.planCost.powerEvalCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
				</tr>
				<tr class="listviewHeader">
					<td colspan="6" align="left">
					其他
					</td>
				</tr>
				<tr class="listviewTR">
					<td width="8%" class="listviewTD" align="right">总费用：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input datarule="number"  datarulejson='{"displayName":"总费用其他费用","precision":"6","length":"8"}' cost="total"  type="text" class="text" name="fieldMap['${field.name}'].planYearFee.totalCost.otherCost" <#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.otherCost??>value="${currentyearfee.totalCost.otherCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.totalCost?? && currentyearfee.totalCost.otherCost??>${currentyearfee.totalCost.otherCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
					<td width="8%" class="listviewTD" align="right">已拨付：</td>
					<td width="25%" class="listviewContent">
						<label cost="paid"><#if currentyearfee?? && currentyearfee.paidCost?? && currentyearfee.paidCost.otherCost??>${currentyearfee.paidCost.otherCost?c}</#if></label>&nbsp;&nbsp;万元
					</td>
					<td width="8%" class="listviewTD" align="right"><@renderMandatory/>当年计划：</td>
					<td width="25%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<input  datarule="number"  datarulejson='{"displayName":"当年计划其他费用","precision":"6","length":"8","isRequired":"0"}' cost="plan" type="text" class="text" name="fieldMap['${field.name}'].planYearFee.planCost.otherCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.otherCost??>value="${currentyearfee.planCost.otherCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.otherCost??>${currentyearfee.planCost.otherCost?c}</#if>&nbsp;&nbsp;万元
						</#if>	
					</td>
				</tr>
				</#if>
				<tr class="listviewHeader">
					<td colspan="2" align="left">
					小计
					</td>
				</tr>
				<tr class="listviewTR">
					<td width="10%" class="listviewTD" align="right">当年计划：</td>
					<td width="90%" class="listviewContent">
						<#if !formField.readonly?? || formField.readonly=="0">
							<label id="sumPlanCostLabel"><#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.sumCost??>${currentyearfee.planCost.sumCost?c}<#else>0</#if></label>
							<input id="sumPlanCost" type="hidden" name="fieldMap['${field.name}'].planYearFee.planCost.sumCost" <#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.sumCost??>value="${currentyearfee.planCost.sumCost?c}"</#if>>&nbsp;&nbsp;万元
						<#else>
							<label id="sumPlanCostLabel"><#if currentyearfee?? && currentyearfee.planCost?? && currentyearfee.planCost.sumCost??>${currentyearfee.planCost.sumCost?c}<#else>0</#if></label>&nbsp;&nbsp;万元
						</#if>
					</td>
				</tr>
				</table>
				<table cellspacing="0" width="100%" border="0" cellpadding="0" >
				<tr class="listviewHeader">
					<td colspan="2" align="left">
					财务预算文件
					</td>
				</tr>
				<tr class="listviewTR">
				<td colspan="2" class="listviewContent" align="left">
					<div style="width:650px">
					<table cellspacing="0" id="nextFileTable${field.name}" cellpadding="0" width="100%">
						<#if fileinfo_list?? && (fileinfo_list?size?default(0) > 0)>
						<#assign index = 1>
						<tr class="listviewTR">
						<td width="85%" colSpan=6 style="line-height:20px">
						<#list fileinfo_list as fileinfo>
						<div id="fileInfo${field.name}${fileinfo.fileId}">
							<input type=hidden name="fieldMap['${field.name}'].planYearFee.oldFileQueue[${index}].fileId" value="${fileinfo.fileId}">
								<div style="position:relative;+position:static;_position:static;float:left;clear:left">
									<span class="fileName">
										<div style="width:650px">
											<div style="position:relative;+position:static;_position:static;clear:left;float:left;padding:2px;clear:left;width:20px">
												<img border="0" src="/PNPMS/script/plugins/Uploadify/global.jpg" class="statusimg">
											</div>
											<div style="position:relative;+position:static;_position:static;float:left;width:500px">
												&nbsp;[${fileinfo.dateTime?string('yyyy-MM-dd')}]&nbsp;&nbsp;<a href="javascript:void(0);" onclick="downloadAttachment${field.name?replace('.','_')}('${fileinfo.fileId}');return false;"><#if fileinfo.realName?? && fileinfo.aliasName??><span title="${fileinfo.realName}">${fileinfo.aliasName}</span><#else>${fileinfo.realName}</#if></a>
												<#if fileinfo.ext?? && (fileinfo.ext=='doc' || fileinfo.ext=='DOC' || fileinfo.ext=='docx' || fileinfo.ext=='DOCX' || fileinfo.ext=='xls' || fileinfo.ext=='XLS' || fileinfo.ext=='xlsx' || fileinfo.ext=='XLSX' || fileinfo.ext=='pdf' || fileinfo.ext=='PDF' || fileinfo.ext=='jpg' || fileinfo.ext=='JPG' || fileinfo.ext=='jpeg' || fileinfo.ext=='JPEG' || fileinfo.ext=='bmp' || fileinfo.ext=='BMP' || fileinfo.ext=='png' || fileinfo.ext=='PNG' || fileinfo.ext=='gif' || fileinfo.ext=='GIF' || fileinfo.ext=='tif' || fileinfo.ext=='TIF' || fileinfo.ext=='ppt' || fileinfo.ext=='PPT' || fileinfo.ext=='pptx' || fileinfo.ext=='PPTX')>
												&nbsp;<a href="javascript:void(0);" onclick="viewAttachment${field.name?replace('.','_')}('${fileinfo.fileId}');return false;">预览</a>
												</#if>
											</div>
											<div style="position:relative;+position:static;_position:static;float:left;width:20px" class="cancel">
												<#if !formField.readonly?? || formField.readonly=="0">
												<a href="javascript:void(0);" onclick="deleteAttachment${field.name?replace('.','_')}('${fileinfo.fileId}');return false;"><img border="0" src="/PNPMS/theme/default/images/main/delete.png"/></a>
												</#if>
											</div>
										</div>
									</span>
								</div>
							</div>
							<#assign index = index+1>
						</#list>
						</td>
						</tr>
						</#if>
						<tr class="listviewTR">
						<td width="85%" colSpan=6>
						<#if !formField.readonly?? || formField.readonly=="0">
						<div id="fieldMap['${field.name}'].planYearFee.fileQueue" style="text-align: left;">
						<#assign index=1>
						<#if businessInstanceField?? && businessInstanceField.planYearFee?? && businessInstanceField.planYearFee.fileQueue??>
						<#list businessInstanceField.planYearFee.fileQueue as fileInfo>
						<#if fileInfo?? && fileInfo.realName??>
						<div id="uploadify${field.name}newfile${index}" class="uploadifyQueueItem completed" style="width:650px">
						<div style="width:520px;clear:left;float:left">
						<span class="fileName">
						<img class="statusimg" border="0" src="/PNPMS/script/plugins/Uploadify/global.jpg">
						&nbsp;${fileInfo.realName?default('')}(${fileInfo.fileSize?default('')})
						</span>
						<span class="percentage"></span>
						</div>
						<div class="cancel" style="padding:2px;float:left;width:20px">
						<a href="javascript:jQuery('#uploadify${field.name}').uploadifyCancel('newfile${index}')">
						<img border="0" src="/PNPMS/theme/default/images/main/delete.png">
						</a>
						</div>
						<input id="uploadify${field.name}newfile${index}hidvalue" type="hidden" value='{"aliasName":null,"company":null,"dateTime":null,"ext":null,"fileData":null,"fileId":null,"fileType":null,"length":0,"node":null,"fileSize":"${fileInfo.fileSize}","realName":"${fileInfo.realName}","realPath":"${fileInfo.realPath?replace('\\','/')}"}' name="fieldMap['${field.name}'].planYearFee.fileQueue">
						</div>
						<#assign index=index + 1>
						</#if>
						</#list>
						</#if>
						</div>
						<div style="clear:both">
						
<#if templeteInstance?? && isDownLoadTemplete??>
					<table cellspacing="0" cellpadding="0" style="border:0px;"><tr><td style="border:0px;">
									<input type="file" name="uploadify${field.name}" id="uploadify${field.name?replace('.','_')}" />
									</td><td style="border:0px;">
									<a href="#" class="button" tabindex="-1"><input type="button" onclick="downLoadFunction('${templeteInstance}','download/downLoad');return false;" value="下载模板"></a>
									</td></tr></table>
									
					<#else>	
					<input type="file" name="uploadify${field.name}" id="uploadify${field.name?replace('.','_')}" />
					</#if>
						
						
						
						</#if>
						</td>
						</tr>
						</table>
				</td>
				</tr>
			</table>
			</div>
		</td>
	</tr>
	<#if showHistory?default('false') == 'true'>
	<tr>
		<td>
		<table id="historyFeeTable" cellspacing="0" width="100%" border="0" cellpadding="0" class="listviewTable">
				<tr class="listviewHeader">
					<td>
						<div id="showYearFeeSpan" onclick="showFeeHistoryList();return false;" class="tableOpen"></div><div style="float:left;line-height:17px;">历史年度费用</div>
					</td>
				</tr>
				<tr id="monthHistoryList">
					<td>			
		<div id="currentFeeList">
		<table cellspacing="1" width="100%" border="0" cellpadding="0" class="listviewTable">
		<tr class="listviewHeader">
			<td class="listviewTD">年度</td>
			<td class="listviewTD">前期协调费</td>
			
			<#if yearfee_type?default('1') != "2">
			<td class="listviewTD">选址选线</td>
			<td class="listviewTD">招标代理</td>
			</#if>
			
			<td class="listviewTD">可研</td>
			<td class="listviewTD">可研评审</td>
			
			<#if yearfee_type?default('1') != "2">
			<td class="listviewTD">环评</td>
			<td class="listviewTD">水保</td>
			<td class="listviewTD">规划选址评估</td>
			<td class="listviewTD">土地调规</td>
			<td class="listviewTD">节能评估</td>
			<td class="listviewTD">其他（具体）</td>
			</#if>
			
			<td class="listviewTD">小计</td>
		</tr>
		<#list yearfee_list as yearfee>
		<#if yearfee?? && yearfee.year?? && yearfee.year!=year>
		<tr class="listviewTR">
			<td class="listviewTD">${yearfee.year}年</td>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.manageCost??>${yearfee.planCost.manageCost?c}</#if>&nbsp;&nbsp;万元</td>
			<#if yearfee_type?default('1') != "2">
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.locationCost??>${yearfee.planCost.locationCost?c}</#if>&nbsp;&nbsp;万元</td>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.desginCost??>${yearfee.planCost.desginCost?c}</#if>&nbsp;&nbsp;万元</td>
			</#if>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.feasibilityCost??>${yearfee.planCost.feasibilityCost?c}</#if>&nbsp;&nbsp;万元</td>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.feasibilityReviewCost??>${yearfee.planCost.feasibilityReviewCost?c}</#if>&nbsp;&nbsp;万元</td>
			<#if yearfee_type?default('1') != "2">
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.environmentCost??>${yearfee.planCost.environmentCost?c}</#if>&nbsp;&nbsp;万元</td>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.waterCost??>${yearfee.planCost.waterCost?c}</#if>&nbsp;&nbsp;万元</td>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.planLocationCost??>${yearfee.planCost.planLocationCost?c}</#if>&nbsp;&nbsp;万元</td>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.landCost??>${yearfee.planCost.landCost?c}</#if>&nbsp;&nbsp;万元</td>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.powerEvalCost??>${yearfee.planCost.powerEvalCost?c}</#if>&nbsp;&nbsp;万元</td>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.otherCost??>${yearfee.planCost.otherCost?c}</#if>&nbsp;&nbsp;万元</td>
			</#if>
			<td class="listviewTD"><#if yearfee?? && yearfee.planCost?? && yearfee.planCost.sumCost??>${yearfee.planCost.sumCost?c}</#if>&nbsp;&nbsp;万元</td>
		</tr>
		</#if>
		</#list>
		</table>
		</div>
		</td>
		</tr>
		</table>
		</td>
	</tr>
	</#if>
</table>
<script language="javascript">
	<#if showHistory?default('false') == 'true'>
	function showFeeHistoryList() {
		if($('#showYearFeeSpan').hasClass("tableOpen")) {
			$('#currentFeeList').hide();
			$('#showYearFeeSpan').removeClass("tableOpen");
			$('#showYearFeeSpan').addClass("tableClose");
		} else {
			$('#currentFeeList').show();
			$('#showYearFeeSpan').removeClass("tableClose");
			$('#showYearFeeSpan').addClass("tableOpen");
		}
	}
	</#if>

	function sumTotalCostResult() {
		var sum = new Number(0);
		
		$('input[cost="total"]','#feeTable').each(function(){
			if($(this).val()!='' && $(this).attr('id')!='sumTotalCost') {
				try{
					var cost = new Number($(this).val());
					if(cost && cost+''!='NaN' && cost!=null) {
						sum  = sum + cost;
						$('#sumTotalCost').val(sum);
						if($('#sumTotalCostLabel').html()=='') {
							if(sum!=0) {
								$('#sumTotalCostLabel').html(sum);
								$('#sumTotalCost').val(sum);
							}
						} else {
							$('#sumTotalCostLabel').html(sum);
							$('#sumTotalCost').val(sum);
						}
					}
				}catch(e){}
			}
		});
	}
	
	function sumPaidCostResult() {
		var sum = new Number(0);
		
		$('input[cost="paid"]','#feeTable').each(function(){
			if($(this).val()!='' && $(this).attr('id')!='sumPaidCost') {
				try{
					var cost = new Number($(this).val());
					if(cost && cost+''!='NaN' && cost!=null) {
						sum  = floatAdd(sum,cost);
						$('#sumPaidCost').val(sum);
						if($('#sumPaidCostLabel').html()=='') {
							if(sum!=0) {
								$('#sumPaidCostLabel').html(sum);
								$('#sumPaidCost').val(sum);
							}
						} else {
							$('#sumPaidCostLabel').html(sum);
							$('#sumPaidCost').val(sum);
						}
					}
				}catch(e){}
			}
		});
	}
	
	function sumPlanCostResult() {
		var sum = new Number(0);
		
		$('input[cost="plan"]','#feeTable').each(function(){
			if($(this).val()!='' && $(this).attr('id')!='sumPlanCost') {
				try{
					var cost = new Number($(this).val());
					if(cost && cost+''!='NaN' && cost!=null) {
						sum  = floatAdd(sum,cost);
						$('#sumPlanCost').val(sum);
						if($('#sumPlanCostLabel').html()=='') {
							if(sum!=0) {
								$('#sumPlanCostLabel').html(sum);
								$('#sumPlanCost').val(sum);
							}
						} else {
							$('#sumPlanCostLabel').html(sum);
							$('#sumPlanCost').val(sum);
						}
					}
				}catch(e){}
			}
		});
	}
	
	<#if !formField.readonly?? || formField.readonly=="0">
	$(document).ready(function(){
		$('input[cost="total"]','#feeTable').blur(function(){
			sumTotalCostResult();
		});
		$('input[cost="paid"]','#feeTable').blur(function(){
			sumPaidCostResult();
		});
		$('input[cost="plan"]','#feeTable').blur(function(){
			sumPlanCostResult();
		});
		$(document.getElementById('uploadify${field.name?replace('.','_')}')).uploadify({
            'basepath'       : TDQS.CONTEXT_PATH,
            'queueID'        : "fieldMap['${field.name}'].planYearFee.fileQueue",
            'fileDesc' :  '请选择财务预算文件',
            'sizeLimit' :1024*1024*100,
            'fileExt' :'*.doc;*.docx;*.xls;*.xlsx;*.pdf;*.zip;*.rar;*.jpg;*.jpeg;*.gif;*.png;*.bmp;*.DWG;*.psd;*.dws;*.dxf;*.dwt;*.ppt;*.pptx;*.mmp;*.vsd;*.tif'
            ,
		    'onSelect' : function(){
            	$('.button','.buttonBox').attr('disabled','disabled');
            },
            'onCancel' : function(){
            	$('.button','.buttonBox').attr('disabled',false);
            },
        	'onComplete' : function(event, ID, fileObj, response, data){
            	$('.button','.buttonBox').attr('disabled',false);
            },
            'onError' : function(){
            	$('.button','.buttonBox').attr('disabled',false);
            },
            'onFileSizeError' : function(){
            	$('.button','.buttonBox').attr('disabled',false);
            }
        });
	});
	
	function bindTotalFeeValidation(){
		$.validator.addMethod("validateTotalFee", function(value, element, params) {
	    	if (value == '') {
				return true;
			}
	    	
	    	var tr = $(element).parent().parent();
			var planFee = $('input[cost="plan"]',tr).val();
			var paidFee = $('label[cost="paid"]',tr).text();
			
			planFee = planFee && planFee == '' ? 0 : new Number(planFee);
			paidFee = paidFee && paidFee == '' ? 0 : new Number(paidFee);
			
			return new Number(value) >= floatAdd(planFee,paidFee);
		}, "总费用应大于等于当年计划与已拨付之和！");
		
		var totalFeeValRule = {};
		totalFeeValRule["validateTotalFee"] = true;
		$('input[cost="total"]','#feeTable').each(function(i){
			$(this).rules("add", totalFeeValRule);
		});
		
	};
	
	TDQS.CALLBACK.afterValidatorInitialed.push(bindTotalFeeValidation);
	</#if>
	
</script>